package com.lcy.web.handler;

import com.jfinal.handler.Handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by loucunyin on 2017/1/11 0011.
 * 传递常用路径到模板
 */
public class PathHandler extends Handler{
    @Override
    public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
        String contextPath = request.getContextPath();
        request.setAttribute("contextPath",contextPath);
        this.next.handle(target, request, response, isHandled);
    }
}
